package ling.common;

import com.ruoyi.common.utils.poi.ExcelHandlerAdapter;
import org.apache.poi.ss.usermodel.CellStyle;
import org.apache.poi.ss.usermodel.*;

public class ExcelHandle implements ExcelHandlerAdapter {
    public static interface rowSetHeader{
         void after(Row row);
    }
    @Override
    public Object format(Object value, String[] args, Cell cell, Workbook wb)
    {


            CellStyle style = wb.createCellStyle();
//            style.setAlignment(HorizontalAlignment.CENTER);
//            style.setVerticalAlignment(VerticalAlignment.CENTER);
//            style.setBorderRight(BorderStyle.THIN);
//            style.setRightBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
//            style.setBorderLeft(BorderStyle.THIN);
//            style.setLeftBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
//            style.setBorderTop(BorderStyle.THIN);
//            style.setTopBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
//            style.setBorderBottom(BorderStyle.THIN);
//            style.setBottomBorderColor(IndexedColors.GREY_50_PERCENT.getIndex());
            Font dataFont = wb.createFont();
            dataFont.setFontName("Arial");
            dataFont.setFontHeightInPoints((short) 12);
            //dataFont.setColor(IndexedColors.RED.index);
            style.setFont(dataFont);
            cell.setCellStyle(style);

        return value;
    }
}